package com.haoyun.mirage.gateway.client;

import com.haoyun.mirage.gateway.client.fallback.UserServiceClientFallBack;
import com.haoyun.mirage.gateway.dto.MenuDTO;
import com.haoyun.mirage.gateway.vo.UserVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Created by twg on 2018/5/31.
 */
@FeignClient(name = "userservice-v1",fallback = UserServiceClientFallBack.class)
public interface UserServiceClient {

    @GetMapping("/menu/findMenuByRole/{role}")
    List<MenuDTO> findMenuByRole(@PathVariable("role") String role);

    @GetMapping("/user/getUserByName/{username}")
    UserVO getUserByName(@PathVariable("username") String username);

}
